package com.mall.ibatis.bean;

import java.io.Serializable;
import com.mall.util.StringUtil;
import com.thoughtworks.xstream.XStream;

@SuppressWarnings("serial")
public class SysPara implements Serializable,ICell
{
	
	 /* Private Fields */
	private String ID;
	private String title;
	private String isVisiable;
	private String isEdit;
	private String dataType;
	private String value;
	private String reference;
	
	/* JavaBeans Properties */
	public String getID()
	{
		return ID;
	}
	public void setID(String ID)
	{
		this.ID = ID;
	}
	public String getTitle()
	{
		return title;
	}
	public void setTitle(String title)
	{
		this.title = title;
	}
	public String getIsVisiable()
	{
		return isVisiable;
	}
	public void setIsVisiable(String isVisiable)
	{
		this.isVisiable = isVisiable;
	}
	public String getIsEdit()
	{
		return isEdit;
	}
	public void setIsEdit(String isEdit)
	{
		this.isEdit = isEdit;
	}
	public String getDataType()
	{
		return dataType;
	}
	public void setDataType(String dataType)
	{
		this.dataType = dataType;
	}
	public String getValue()
	{
		return value;
	}
	public void setValue(String value)
	{
		this.value = value;
	}
	public String getReference()
	{
		return reference;
	}
	public void setReference(String reference)
	{
		this.reference = reference;
	}
	
	/* ICell method*/
	public String toCell()
	{
		// TODO Auto-generated method stub
		StringBuffer cellBuffer  = new StringBuffer();
		cellBuffer.append("<ID><![CDATA[" + StringUtil.null2Empty(ID)+"]]></ID>");
		cellBuffer.append("<title><![CDATA[" + StringUtil.null2Empty(title)+"]]></title>");
		cellBuffer.append("<isVisiable><![CDATA[" + StringUtil.null2Empty(isVisiable)+"]]></isVisiable>");
		cellBuffer.append("<isEdit><![CDATA[" + StringUtil.null2Empty(isEdit)+"]]></isEdit>");
		cellBuffer.append("<dataType><![CDATA[" + StringUtil.null2Empty(dataType)+"]]></dataType>");
		cellBuffer.append("<value><![CDATA[" + StringUtil.null2Empty(value)+"]]></value>");
		cellBuffer.append("<reference><![CDATA[" + StringUtil.null2Empty(reference)+"]]></reference>");
		return cellBuffer.toString();
	}
	
	public String getCellID()
	{
		
		return StringUtil.null2Empty(ID);
		
	}
	
	public String toXML()
	{
		XStream xStream = new XStream();
		xStream.alias(this.getClass().getSimpleName(),this.getClass());
		return xStream.toXML(this);
	}
}